package com.aaa.qy127.controller;

import com.aaa.qy127.entity.User;
import com.aaa.qy127.service.UserService;
import com.aaa.qy127.util.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/yonghu")
public class UserController {
    @Resource(name="UserServiceImpl")
    private UserService userService;
    /**
     * 获取用户信息
     * @param user
     * @return
     */
    @RequestMapping("/list")
    public Result getUser(User user){
        Result list = userService.getUser(user);
        return list;
    }
    /**
     * 获取用户禁用信息
     * @param user
     * @return
     */
    @RequestMapping("cause")
    public Result getcause(User user){
        Result getcause = userService.getcause(user);
        return getcause;
    }
    /**
     * 修改禁用状态
     * @param user
     * @return
     */
    @RequestMapping("/no")
    public String statusno(User user){
        String statusno = userService.statusno(user);
        return statusno;
    }
    /**
     * 修改使用状态
     * @param user
     * @return
     */
    @RequestMapping("/yes")
    public String statuyes(User user){
        String statusyes = userService.statusyes(user);
        return statusyes;
    }
}
